package org.sk.gsync.ui;

import javax.swing.JFrame;

import org.sk.gsync.ui.context.AbstractContext;

public abstract class DefaultFrame extends JFrame {

    private static final long serialVersionUID = -7221866896245852745L;

    protected AbstractContext context;

    protected int selectedOption;

    public AbstractContext getContext() {
        return context;
    }

    public int open() {
        setVisible(true);
        while (isVisible()) {
            Thread.yield();
        }
        return selectedOption;
    }

    protected void setContext(final AbstractContext context) {
        this.context = context;
    }

    public abstract void configure();

    public abstract void updateContext();

}
